package com.lanswon.qzsmk.controller.inventoryManageController;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.lanswon.qzsmk.annotation.SystemControllerLog;
import com.lanswon.qzsmk.service.systemManageService.InventoryManagementService;

import ch.qos.logback.classic.Logger;

@Controller
@RequestMapping(value = "/inventoryQueryOfRequestAndReturnReg")
public class InventoryQueryOfRequestAndReturnByEmpRegController {
	private final static Logger logger = (Logger) LoggerFactory.getLogger(InventoryQueryOfRequestAndReturnByEmpRegController.class);
	
	@Autowired
	InventoryManagementService ims;
	
	@RequiresPermissions("inventoryQueryOfRequestAndReturnReg:index")
	@RequestMapping(name = "柜员领用归还记录查询,inventoryQueryOfRequestAndReturnReg:index",value = "/queryRequestAndReturnReg", method = RequestMethod.GET)
	@SystemControllerLog(description = "跳转领用查询页面")
	public String queryInventory(HttpServletRequest request) {

		return "RequestAndReturnByEmpReg";
	}
	
	@RequiresPermissions("inventoryQueryOfRequestAndReturnReg:getRequestAndReturnInfo")
	@RequestMapping(name = "领用归还记录查询结果加载,inventoryQueryOfRequestAndReturnReg:getRequestAndReturnInfo",value="/getRequestAndReturnInfo",method=RequestMethod.POST)
	@ResponseBody
	@SystemControllerLog(description = "查询结果")
	public Map<String, Object> getRequestAndReturnInfo(HttpServletRequest request) throws Exception{
		Map<String, Object> rMap = new HashMap<String,Object>();
		rMap = ims.getRequestAndReturnInfo(request);
		logger.debug("rMap==>"+rMap);
		return rMap;
	}	
}
